const request = require("../utils/requst");
const sop = "/sop/api";
const scope = "sop";
// 用户信息
const getUser = (data) =>
  request(sop, { scope, cmdCode: "USER_GET", source: data });
const getolduser = (data) =>
  request(sop, {
    scope,
    reqCode: "USER_REFRESH",
    cmdCode: "USER_GET",
    source: data,
  });

//修改用户信息
const putuser = (data) =>
  request(sop, { scope, cmdCode: "USER_PATCH", source: data });
//实名认证
const real = (data) =>
  request(sop, { scope, cmdCode: "USER_REAL_NAME", source: data });

// 手机号
const getaaa = (data) =>
  request(sop, { scope, cmdCode: "USER_PHONE_GET", source: data });
//岗位分享
const work_share = (data) =>
  request(sop, { scope, cmdCode: "WORK_SHARE", source: data });
//岗位id查询
const work_id = (data) =>
  request(sop, { scope, cmdCode: "WORK_GET", source: data });
// 岗位列表排序
const work_list = (data) =>
  request(sop, {
    scope,
    cmdCode: "WORK_LIST",
    pageIndex: data.page,
    pageSize: data.size,
    source: data.data,
    reqCode: data.reqCode,
  });
//岗位工种查询
const work_to_type = (data) =>
  request(sop, { scope, cmdCode: "WORK_TO_TYPE_GET", source: data });
//浏览记录
const browse = (data) =>
  request(sop, { scope, cmdCode: "WORK_HISTORY", source: data });
//收藏
const getcollect = (data) =>
  request(sop, {
    scope,
    cmdCode: "WORK_COLLECT_LIST",
    pageSize: data.limit,
    pageIndex: data.page,
    source: data.data,
  });
const postcollect = (data) =>
  request(sop, {
    scope,
    cmdCode: "WORK_COLLECT_POST",
    source: data,
  });
const delcollect = (data) =>
  request(sop, {
    scope,
    cmdCode: "WORK_COLLECT_DEL",
    source: data,
  });
const iscollect = (data) =>
  request(sop, { scope, cmdCode: "COLLECT_OR_NOT", source: data });
//地区招商
const apply = (data) =>
  request(sop, { scope, cmdCode: "WORK_APPLY_POST", source: data });
//浏览记录
const histort = (data) =>
  request(sop, { scope, cmdCode: "WORK_HISTORY", source: data });
//入职
const entry = (data) =>
  request(sop, { scope, cmdCode: "WORK_ENTRY_POST", source: data });
const entrylist = (data) =>
  request(sop, {
    scope,
    cmdCode: "WORK_ENTRY_LIST",
    pageIndex: data.page,
    source: data.data,
  });
const money = (data) =>
  request(sop, {
    scope,
    cmdCode: "USER_GET_MONEY",
    source: JSON.stringify(data),
  });
const paylist = (data) =>
  request(sop, {
    scope,
    cmdCode: "PAY_PAYMENT_LIST",
    source: JSON.stringify(data.data),
    pageSize: data.limit,
    pageIndex: data.page,
  });
const entryget = (data) =>
  request(sop, {
    scope,
    cmdCode: "WORK_ENTRY_GET",
    source: JSON.stringify(data),
  });
const entryOrNot = (data) =>
  request(sop, {
    scope,
    cmdCode: "WORK_ENTRY_OR_NOT",
    source: JSON.stringify(data),
  });

module.exports = {
  getUser,
  putuser,
  getaaa,
  work_list,
  work_share,
  work_id,
  work_to_type,
  browse,
  getcollect,
  postcollect,
  delcollect,
  iscollect,
  apply,
  histort,
  real,
  entry,
  entrylist,
  getolduser,
  money,
  paylist,
  entryget,
  entryOrNot,
};
